//============================================================================
// Name        : April13.cpp
// Author      : Anthony Varghese
// Version     :
// Copyright   : Your copyright notice
// Description : Uses the Stack class and the Queue class
//============================================================================

#include <iostream>
#include "Stack.h"
#include "Queue.h"

using namespace std;

int main(){
	cout << "Stack and Queue client: check if what the user enters is a palindrome." << endl << endl;
	cout << "   Enter a line of characters> " << flush;
	Stack s;
	Queue q;

	char c;
	do {
		cin.get( c );
		if (c == '\n')
			break;
		s.push( c );
		q.enqueue( c );
	} while (c != '\n');

	while ( ! s.is_empty() )
		if ( s.pop() != q.dequeue() ) {
			cout << "Not a palindrome!" << endl;
			break;
		} else {
			if (s.is_empty())
				cout << "It is a palindrome!" << endl;
		}
}
